using System;
using Common.Logging;

namespace Agatha.Common
{
    public interface ILogManager
    {
        void SetLogName(string name);
        void SetLogType(Type type);
        void Debug(object message, System.Exception exception);
        void Warn(object message, System.Exception exception);
        void Info(object message, System.Exception exception);
        void Error(object message, System.Exception exception);

        void Debug(object message);
        void Warn(object message);
        void Info(object message);
        void Error(object message);
    }
    public class LogManagerWrapper : ILogManager
    {
        private ILog logger;
        public LogManagerWrapper()
        {
            logger = LogManager.GetLogger("Application");
        }
      
        public void SetLogName(string name)
        {
            logger = LogManager.GetLogger(name);
        }

        public void SetLogType(Type type)
        {
            logger = LogManager.GetLogger(type);
        }

        public void Debug(object message, Exception exception)
        {
            logger.Debug(message, exception);
        }

        public void Warn(object message, Exception exception)
        {
            logger.Warn(message, exception);
        }

        public void Info(object message, Exception exception)
        {
            logger.Info(message, exception);
        }

        public void Error(object message, Exception exception)
        {
            logger.Error(message, exception);
        }
        public void Debug(object message)
        {
            logger.Debug(message);
        }

        public void Warn(object message)
        {
            logger.Warn(message);
        }

        public void Info(object message)
        {
            logger.Info(message);
        }

        public void Error(object message)
        {
            logger.Error(message);
        }

    }
}